toolbar chevrons
authorcinamod <cinamod>
Fri, 29 Aug 2003 21:00:14 +0000 (21:00 +0000)
committercinamod <cinamod>
Fri, 29 Aug 2003 21:00:14 +0000 (21:00 +0000)
modules/engines/ms-windows/ChangeLog.old
modules/engines/ms-windows/wimp_style.c
modules/engines/ms-windows/xp_theme.c
modules/engines/ms-windows/xp_theme.h

index 6d0aaaac84ae69456da6ff034bb0302cbfc7c3f6..7b786ef1646664a67e14f776fa831f2bf0a75d49 100755 (executable)
@@ -1,3 +1,7 @@
+2003-08-29  Dom Lachowicz <cinamod@hotmail.com>
+
+       * src/*.c: Theme GTK toolbar arrows to XP chevrons, once my GTK patch is committed.
+
 2003-08-28  Dom Lachowicz <cinamod@hotmail.com>
 
        * src/wimp_style.c: Change how we draw handle boxes in the non-XP case. This does not yet apply to GtkHandleBoxes
index df02b31f8247fa08234ddc7a9c27ee3eff96f40c..1d53e1aa66ecb4ca99d0c6808b4f3d00f063e5a7 100755 (executable)
@@ -724,6 +724,10 @@ draw_arrow (GtkStyle      *style,
            gint           width,
            gint           height)
 {
+  const gchar * name;
+
+  name = gtk_widget_get_name (widget);
+
   sanitize_size (window, &width, &height);
 
   if (detail && strcmp (detail, "spinbutton") == 0)
@@ -792,6 +796,12 @@ draw_arrow (GtkStyle      *style,
     }
   else
     {
+         if (name && !strcmp (name, "gtk-toolbar-arrow"))
+         {
+                 if (xp_theme_draw(window, XP_THEME_ELEMENT_CHEVRON, style, x, y, width, height, state))
+                               return;
+         }
+
       if (arrow_type == GTK_ARROW_UP || arrow_type == GTK_ARROW_DOWN)
        {
          x += (width - 7) / 2;
@@ -855,6 +865,10 @@ draw_box (GtkStyle      *style,
          gint           width,
          gint           height)
 {
+  const gchar * name;
+
+  name = gtk_widget_get_name (widget);
+
   if (detail &&
       (!strcmp (detail, "button") ||
        !strcmp (detail, "buttondefault")))
@@ -928,7 +942,7 @@ draw_box (GtkStyle      *style,
                return;
          }
   }
-  else if (!strcmp (gtk_widget_get_name (widget), "gtk-tooltips")) {
+  else if (name && !strcmp (name, "gtk-tooltips")) {
       if (xp_theme_draw (window, XP_THEME_ELEMENT_TOOLTIP, style, x, y, width, height, state_type))
         {
                return;
index 17dfb798f40b27789b1146821bd09eae18e29842..0823807840aba4f41beec6555262b66b1b272370 100755 (executable)
@@ -81,6 +81,7 @@ static const short element_part_map[]=
   RP_BAND,
   RP_GRIPPER,
   RP_GRIPPERVERT,
+  RP_CHEVRON,
   TP_BUTTON
 };
 
@@ -173,6 +174,7 @@ xp_theme_get_handle_by_element(XpThemeElement element)
     case XP_THEME_ELEMENT_REBAR:
     case XP_THEME_ELEMENT_GRIPPER_H:
     case XP_THEME_ELEMENT_GRIPPER_V:
+    case XP_THEME_ELEMENT_CHEVRON:
       klazz = XP_THEME_CLASS_REBAR;
       break;
 
@@ -263,6 +265,20 @@ xp_theme_map_gtk_state(XpThemeElement element, GtkStateType state)
       ret = 0;
       break;
 
+       case XP_THEME_ELEMENT_CHEVRON:
+               switch (state)
+               {
+        case GTK_STATE_PRELIGHT:
+          ret =  CHEVS_HOT;
+          break;
+        case GTK_STATE_SELECTED:
+        case GTK_STATE_ACTIVE:
+          ret =  CHEVS_PRESSED;
+          break;
+        default:
+          ret =  CHEVS_NORMAL;
+               }
+
     case XP_THEME_ELEMENT_TOOLBAR:
       ret = 1;
       break;
index 6720e509c22d90ee9534cffc8986b4dd72db5e0f..71c9eb87055a7dbdd46d83221c15c5f38dfa7e0d 100755 (executable)
@@ -77,6 +77,7 @@ typedef enum
   XP_THEME_ELEMENT_REBAR,\r
   XP_THEME_ELEMENT_GRIPPER_H,\r
   XP_THEME_ELEMENT_GRIPPER_V,\r
+  XP_THEME_ELEMENT_CHEVRON,\r
   XP_THEME_ELEMENT_TOOLBAR,\r
   XP_THEME_ELEMENT__SIZEOF\r
 } XpThemeElement;\r